import request from '@/utils/request'

/**
 * 添加会员
 * @param data
 * @returns {AxiosPromise}
 */
export function addMember(data) {
  return request({
    url: '/member',
    method: 'post',
    data
  })
}

/**
 *分页查询会员
 * @param pageNum 当前页码
 * @param pageSize 每页显示页码
 * @param search 模糊查询
 * @param select 选择查询项目
 * @returns {AxiosPromise}
 */
export function selectMember(pageNum, pageSize, search, select) {
  return request({
    url: '/member',
    method: 'get',
    params: {
      pageNum: pageNum,
      pageSize: pageSize,
      search: search,
      select: select
    }
  })
}

/**
 * 修改会员
 * @param data
 * @returns {AxiosPromise}
 */
export function update(data) {
  return request({
    url: '/member',
    method: 'put',
    data
  })
}

/**
 * 删除商品接口
 * @param id
 * @returns {AxiosPromise}
 */
export function deleteById(id) {
  return request({
    url: '/member/' + id,
    method: 'delete'
  })
}
